package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.Record;
import cn.wolfcode.trip.base.mapper.RecordMapper;
import cn.wolfcode.trip.base.service.IRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RecordServiceImpl implements IRecordService {
    @Autowired
    private RecordMapper recordMapper;

    @Override
    public List<Record> listAll(Long stateDeposit) {
        return recordMapper.selectAll(stateDeposit);
    }

    /**
     * 新增记录
     *
     * @param record
     */
    @Override
    public void insert(Record record) {
        recordMapper.insert(record);
    }

    //提现
    @Override
    public List<Record> listDeposit(Long userId, Long stateDeposit) {
        return recordMapper.listDepositOrRecharge(userId,stateDeposit);
    }
    //充值的记录
    @Override
    public List<Record> listRecharge(Long userId, Long stateTopup) {
        return recordMapper.listDepositOrRecharge(userId,stateTopup);
    }

}
